﻿@{
    ViewBag.Title = "RevisePassword";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'common', 'optimizeSelectOption'], function () {
        var form = layui.form,
            common=layui.common,
            $ = layui.$;
        //自定义验证规则
        form.verify({
             equal: function (value, item) { //value：表单的值、item：表单的DOM对象
                if (value != layui.$('input[name="F_UserPassword"]').val()) {
                    return '密码不相同请重新输入！'
                }
            }
        });
        wcLoading.close();
        //监听提交
        form.on('submit(saveBtn)', function (data) {
            // 单击之后提交按钮不可选,防止重复提交
            $('.site-demo-active').addClass('layui-btn-disabled');
            $('.site-demo-active').attr('disabled', 'disabled');
                var postData = data.field;
                common.submitForm({
                    loading: "正在修改数据...",
                    url: "/SystemOrganize/User/SubmitReviseSelfPassword",
                    param: postData,
                    success: function () {
                    }
                })
            return false;
        });
    });
</script>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form" lay-filter="useradmin">
            <div class="layui-form-item">
                <label class="layui-form-label">新密码</label>
                <div class="layui-input-block">
                    <input type="password" id="F_UserPassword" name="F_UserPassword" maxlength="12" lay-verify="required|pass" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input type="password" id="F_UserPasswordNew" name="F_UserPasswordNew" maxlength="12" lay-verify="required|pass|equal" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn site-demo-active" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
            </div>
        </div>
    </div>
</div>
